package com.ctgu.springstart.exception;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

//@ControllerAdvice
public class CustomExtHandler {

//    @ExceptionHandler(value = Exception.class)
//    @ResponseBody
//    Object handleException(Exception e, HttpServletRequest request){
//        Map<String, Object> map = new HashMap<String, Object>(){{
//           put("code", 100);
//           put("msg", e.getMessage());
//           put("url", request.getRequestURL());
//        }};
//        return map;
//    }
}
